package com.oss.utils.constants;

import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import java.util.Set;

import com.eova.common.utils.io.FileUtil;
import com.jfinal.kit.PathKit;

public class FolderLocation {

    protected static Map<String, String> props = new HashMap<String, String>();

    public static Map<String, String> domainConfig() {
        String resPath = PathKit.getRootClassPath() + File.separator;
        // 加载默认配置
        File[] files = FileUtil.getFiles(resPath + "default");
        for (File file : files) {
            if (file.getName().equals("domain.config")) {
                Properties properties = FileUtil.getProp(file);
                Set<Object> keySet = properties.keySet();
                for (Object ks : keySet) {
                    String key = ks.toString();
                    props.put(key, properties.getProperty(key));
                }
            }
        }
        return props;
    }

    public static String NETWORK_PATH = domainConfig().get("domain_img");
    public static String LOCAL_PATH = domainConfig().get("static_root");


    // 临时目录
    public static final String TEMP = "/temp/";
    // 用户二维码
    public static final String USER_QR = "/userQR/";
    //EXCEL
    public static final String EXCEL = "/excel/";


}
